﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="testInvokeEncCom._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head >
    <title>test</title>
    <object id="objCom" style="height: 0px; width: 0px" classid="clsid:F516633B-835B-4505-BE17-A4D8D0ADC7C7" viewastext></object>
    <script type="text/javascript">
    function testClientInvoke()
    {
        // client side invoke
        var nRet = 0;
        nRet = objCom.OpenSession();
        if (nRet != 0)
        {
            alert('client invoke error!');
            return;
        }
        alert('client invoke success!');
    }
    function testServerInvoke()
    {
        // client side invoke
        window.location = "SvrSide.aspx";
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input id="Button1" type="button" value="client side invoke" onclick="testClientInvoke();"/>
        <input id="Button2" type="button" value="sever side invoke" onclick="testServerInvoke();"/>
    </div>
    </form>
</body>
</html>
